package edu.zju.gis.dbfg.model.statistic;

import lombok.Getter;
import lombok.Setter;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;

@Getter
@Setter
public class LUChangeStatistic22Args implements Serializable{
    private final static Logger logger = LoggerFactory.getLogger(LUChangeStatistic22Args.class);
    @Option(name = "-output",usage = "输出文件路径", required = true)
    private String output;

    @Option(name = "-parallelize", usage="parallelize num")
    private int partitionNum = 4;

    @Option(name = "-scale",usage = "统计级别（省、市、县）")
    private String scale="XIAN";

    @Option(name = "-input1",usage = "输入数据,extent", required = true)
    private String input1;

    @Option(name = "-type1",usage = "输入数据类型,extent", required = true)
    private String type1;

    @Option(name = "-crs1",usage = "extent crs")
    private String crs1 = "4326";

    @Option(name = "-2Dinput2",usage = "输入面状数据,target", required = true)
    private String d2input2;

    @Option(name = "-2Dtype2",usage = "输入数据类型,extent", required = true)
    private String d2type2;

    /**
     * dlbm码的标志，对于wkt文件，则是数字，对于shapefile文件，则是字段名
     */
    @Option(name = "-2DdlbmIndex2",usage = "分类字段(dlbm),target")
    private String d2dlbmIndex2="DLBM";

    @Option(name = "-2DzldwdmIndex2",usage = "行政区划字段,target")
    private String d2zldwdmIndex2="ZLDWDM";

    @Option(name = "-2DareaIndex2",usage = "面积字段(TBMJ),target")
    private String d2areaIndex2="TBMJ";

    @Option(name = "-2DjareaIndex2",usage = "净面积字段(TBDLMJ),target")
    private String d2jareaIndex2="TBDLMJ";

    @Option(name = "-2DkcdlxsIndex2",usage = "扣除地类系数字段(KCDLXS),target")
    private String d2kcdlxsIndex2="TKXS";

    @Option(name = "-2DkcdlbmIndex2",usage = "扣除地类编码字段(KCDLBM),target")
    private String d2kcdlbmIndex2="KCDLBM";

    @Option(name = "-2DtbbhIndex2",usage = "图斑编号字段(TBBH),target")
    private String d2tbbhIndex2="TBBH";

    @Option(name = "-2DtbybhIndex2",usage = "图斑预编号字段(TBYBH),target")
    private String d2tbybhIndex2="TBYBH";

    @Option(name = "-2DxzdwmjIndex2",usage = "线状地物字段(XZDWMJ),target")
    private String d2xzdwmjIndex2="XZDWMJ";

    @Option(name = "-2DlxdwmjIndex2",usage = "零星地物面积字段(LXDWMJ),target")
    private String d2lxdwmjIndex2="LXDWMJ";





    @Option(name = "-2Dinput3",usage = "输入线状数据,target", required = true)
    private String d2input3;

    @Option(name = "-2Dtype3",usage = "输入数据类型,extent", required = true)
    private String d2type3;

    @Option(name = "-2DdlbmIndex3",usage = "分类字段(dlbm),target")
    private String d2dlbmIndex3="DLBM";

    @Option(name = "-2Dkctbdwdm1Index3",usage = "扣除图斑单位代码1(KCTBDWDM1),target")
    private String d2kctbdwdm1Index3="KCTBDWDM1";

    @Option(name = "-2Dkctbdwdm2Index3",usage = "扣除图斑单位代码2(KCTBDWDM2),target")
    private String d2kctbdwdm2Index3="KCTBDWDM2";

    @Option(name = "-2Dkctbbh1Index3",usage = "扣除图斑编号1(KCTBBH1),target")
    private String d2kctbbh1Index3="KCTBBH1";

    @Option(name = "-2Dkctbbh2Index3",usage = "扣除图斑编号2(KCTBBH2),target")
    private String d2kctbbh2Index3="KCTBBH2";

    @Option(name = "-2DkcblIndex3",usage = "扣除比例字段(KCBL),target")
    private String d2kcblIndex3="KCBL";

    @Option(name = "-2DcdIndex3",usage = "长度字段(CD),target")
    private String d2cdIndex3="CD";

    @Option(name = "-2DkdIndex3",usage = "长度字段(KD),target")
    private String d2kdIndex3="KD";


    @Option(name = "-2Dinput4",usage = "输入点状数据,target", required = true)
    private String d2input4;

    @Option(name = "-2Dtype4",usage = "输入数据类型,extent", required = true)
    private String d2type4;

    @Option(name = "-2DdlbmIndex4",usage = "分类字段(dlbm),target")
    private String d2dlbmIndex4="DLBM";

    @Option(name = "-2DzldwdmIndex4",usage = "行政区划字段,target")
    private String d2zldwdmIndex4="ZLDWDM";

    @Option(name = "-2DzltbbhIndex4",usage = "坐落图斑编号字段,target")
    private String d2zltbbhIndex4="ZLTBBH";

    @Option(name = "-2DmjIndex4",usage = "面积字段,target")
    private String d2mjIndex4="MJ";

//    @Option(name = "-2Dcrs1",usage = "extent crs")
//    private String d2crs1 = "4326";

    @Option(name = "-2Dcrs2",usage = "target crs")
    private String d2crs2 = "4326";

    @Option(name = "-2Dcrs3",usage = "extent crs")
    private String d2crs3 = "4326";

    @Option(name = "-2Dcrs4",usage = "target crs")
    private String d2crs4 = "4326";

    @Option(name = "-2D1input2",usage = "输入面状数据,target", required = true)
    private String d21input2;

    @Option(name = "-2D1type2",usage = "输入数据类型,extent", required = true)
    private String d21type2;

    /**
     * dlbm码的标志，对于wkt文件，则是数字，对于shapefile文件，则是字段名
     */
    @Option(name = "-2D1dlbmIndex2",usage = "分类字段(dlbm),target")
    private String d21dlbmIndex2="DLBM";

    @Option(name = "-2D1zldwdmIndex2",usage = "行政区划字段,target")
    private String d21zldwdmIndex2="ZLDWDM";

    @Option(name = "-2D1areaIndex2",usage = "面积字段(TBMJ),target")
    private String d21areaIndex2="TBMJ";

    @Option(name = "-2D1jareaIndex2",usage = "净面积字段(TBDLMJ),target")
    private String d21jareaIndex2="TBDLMJ";

    @Option(name = "-2D1kcdlxsIndex2",usage = "扣除地类系数字段(KCDLXS),target")
    private String d21kcdlxsIndex2="TKXS";

    @Option(name = "-2D1kcdlbmIndex2",usage = "扣除地类编码字段(KCDLBM),target")
    private String d21kcdlbmIndex2="KCDLBM";

    @Option(name = "-2D1tbbhIndex2",usage = "图斑编号字段(TBBH),target")
    private String d21tbbhIndex2="TBBH";

    @Option(name = "-2D1tbybhIndex2",usage = "图斑预编号字段(TBYBH),target")
    private String d21tbybhIndex2="TBYBH";

    @Option(name = "-2D1xzdwmjIndex2",usage = "线状地物字段(XZDWMJ),target")
    private String d21xzdwmjIndex2="XZDWMJ";

    @Option(name = "-2D1lxdwmjIndex2",usage = "零星地物面积字段(LXDWMJ),target")
    private String d21lxdwmjIndex2="LXDWMJ";

    @Option(name = "-2D1input3",usage = "输入线状数据,target", required = true)
    private String d21input3;

    @Option(name = "-2D1type3",usage = "输入数据类型,extent", required = true)
    private String d21type3;

    @Option(name = "-2D1dlbmIndex3",usage = "分类字段(dlbm),target")
    private String d21dlbmIndex3="DLBM";

    @Option(name = "-2D1kctbdwdm1Index3",usage = "扣除图斑单位代码1(KCTBDWDM1),target")
    private String d21kctbdwdm1Index3="KCTBDWDM1";

    @Option(name = "-2D1kctbdwdm2Index3",usage = "扣除图斑单位代码2(KCTBDWDM2),target")
    private String d21kctbdwdm2Index3="KCTBDWDM2";

    @Option(name = "-2D1kctbbh1Index3",usage = "扣除图斑编号1(KCTBBH1),target")
    private String d21kctbbh1Index3="KCTBBH1";

    @Option(name = "-2D1kctbbh2Index3",usage = "扣除图斑编号2(KCTBBH2),target")
    private String d21kctbbh2Index3="KCTBBH2";

    @Option(name = "-2D1kcblIndex3",usage = "扣除比例字段(KCBL),target")
    private String d21kcblIndex3="KCBL";

    @Option(name = "-2D1cdIndex3",usage = "长度字段(CD),target")
    private String d21cdIndex3="CD";

    @Option(name = "-2D1kdIndex3",usage = "长度字段(KD),target")
    private String d21kdIndex3="KD";


    @Option(name = "-2D1input4",usage = "输入点状数据,target", required = true)
    private String d21input4;

    @Option(name = "-2D1type4",usage = "输入数据类型,extent", required = true)
    private String d21type4;

    @Option(name = "-2D1dlbmIndex4",usage = "分类字段(dlbm),target")
    private String d21dlbmIndex4="DLBM";

    @Option(name = "-2D1zldwdmIndex4",usage = "行政区划字段,target")
    private String d21zldwdmIndex4="ZLDWDM";

    @Option(name = "-2D1zltbbhIndex4",usage = "坐落图斑编号字段,target")
    private String d21zltbbhIndex4="ZLTBBH";

    @Option(name = "-2D1mjIndex4",usage = "面积字段,target")
    private String d21mjIndex4="MJ";

//    @Option(name = "-2Dcrs1",usage = "extent crs")
//    private String d2crs1 = "4326";

    @Option(name = "-2D1crs2",usage = "target crs")
    private String d21crs2 = "4326";

    @Option(name = "-2D1crs3",usage = "extent crs")
    private String d21crs3 = "4326";

    @Option(name = "-2D1crs4",usage = "target crs")
    private String d21crs4 = "4326";

    public  static LUChangeStatistic22Args initArgs(String args[]){
        LUChangeStatistic22Args mArgs = new LUChangeStatistic22Args();
        CmdLineParser parser = new CmdLineParser(mArgs);
        try {
            parser.parseArgument(args);
            return mArgs;
        } catch (CmdLineException e) {
            logger.error(e.getLocalizedMessage());
            return null;
        }
    }
}
